#include <SimpleAmqpClient/SimpleAmqpClient.h>
#include <iostream>
int main(){
    // 1 创建channel
    AmqpClient::Channel::ptr_t channel = AmqpClient::Channel::Create();
    // 2 开启消费
    channel->BasicConsume("file-queue");

    // 3 为信封申请内存
    AmqpClient::Envelope::ptr_t envelope; //申请一个envelope的指针
    // 4 BasicConsumeMessage 将消息读取到一个信封中
    bool flag = channel->BasicConsumeMessage(envelope,3000);

    if(flag){
        std::cout << "Body = " << envelope->Message()->Body() << "\n";
    }
    else{
        std::cerr << "timeout!\n";
    }
    return 0;
}